package org.zch.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zch.dao.TipWorksDAO;
import org.zch.entity.po.TipWorksPO;
import org.zch.service.TipWorksService;

import java.util.Date;
import java.util.List;

/**
 * 管理员
 * 方法实现层
 *
 * @author 赵昌虎
 */
@Service
public class TipWorksServiceImpl implements TipWorksService {

    @Autowired
    private TipWorksDAO tipWorksDAO;


    @Override
    public List<TipWorksPO> getTipList() {
        return tipWorksDAO.selectList(null);
    }

    @Override
    public Integer deleteTip(Integer id) {
        return tipWorksDAO.deleteById(id);
    }

    @Override
    public Integer addTip(TipWorksPO tipWorksPO) {
        tipWorksPO.setCreateTime(new Date());
        return tipWorksDAO.insert(tipWorksPO);
    }
}
